﻿using System;
using System.Collections.Generic;

namespace HangerSupport
{
	public class HSBarMatSortCompare : IComparer<HSCalBarInfo>
	{
		public int Compare(HSCalBarInfo curCal, HSCalBarInfo otherOrder)
		{
			this.m_CalInfo = curCal;
			int num = string.Compare(curCal.m_matInfo.m_strCode, otherOrder.m_matInfo.m_strCode);
			bool flag = num != 0;
			int result;
			if (flag)
			{
				result = num;
			}
			else
			{
				num = string.Compare(curCal.m_matInfo.GetSizeInfo(), otherOrder.m_matInfo.GetSizeInfo());
				bool flag2 = num != 0;
				if (flag2)
				{
					result = num;
				}
				else
				{
					num = string.Compare(curCal.m_dLength.ToString("f0"), otherOrder.m_dLength.ToString("f0"));
					bool flag3 = num != 0;
					if (flag3)
					{
						num = ((curCal.m_dLength > otherOrder.m_dLength) ? 1 : -1);
						result = num;
					}
					else
					{
						result = 0;
					}
				}
			}
			return result;
		}

		private HSCalBarInfo m_CalInfo;
	}
}
